home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
051-075
/
disk_069
/
console
/
constest.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-06
|
1KB
|
69 lines
#define printf myprintf
#define getchar mygetc
#define putchar myputc
#define puts myputs
#define exit myexit
#define scanf myscanf
#define gets mygets
extern char FillFlag;
void PressAKey();
char WindowTitle[] = "Test Window for Console Routines";
main()
{
int x1,x2,y1;
puts("How about a try for 'scanf'.");
puts("Enter some regular ASCII, and then a number.");
printf("Input ==> \x9bn");
scanf("%s%d",(char *) x1, &x2);
printf("\nThe string is: %s\nThe number is: %d\n\n",x1,x2);
puts("Now a test of 'gets'.");
printf("==> ");
x1 = gets();
puts("You entered the following line:");
puts(x1);
printf("%d character%c long.\n\n",
(strlen(x1)),(strlen(x1)==1) ? '\0':'s');
PressAKey();
printf("%cOkay. First we'll start with some lines.\n\n",0x0C);
for(x1=300,x2=100,y1=0;y1++<20;x1-=10,x2+=4)
Line(639,199,x1,x2,1);
puts("And now a box or two.\n");
Box(400,50,600,150,2);
FillFlag = 1; /* fill in the next one */
Box(450,70,550,130,2);
FillFlag = 0; /* Turn off filling again */
puts("A Pair of Circles.\n");
Circle(500,40,30,3);
Circle(500,40,10,3);
PressAKey();
exit(0);
}
void PressAKey()
{
puts("Now, wasn't that fun?");
/* CSI 0 <space> p turns cursor off */
puts("\x9b0 pPress any key to continue.");
getchar();
}